﻿function init() {
    em.setProperty("leader", "true");
    em.setProperty("state", "0");
}
function setup(eim, leaderid) {
    em.setProperty("leader", "true");
    var eim = em.newInstance("Cygnus");
    var map = eim.setInstanceMap(271040100);
    map.resetFully();
    var mob1 = em.getMonster(8850000);
    mob1.setHp(6300000000);
    eim.registerMonster(mob1);
    map.spawnMonsterOnGroundBelow(mob1, new java.awt.Point(-363, 100));
    em.setProperty("state", "1");
    eim.startEventTimer(3600000);
    return eim;
}
function playerEntry(eim, player) {
    var map = eim.getMapFactory().getMap(271040100);
    player.changeMap(map, map.getPortal(0));
}
function playerRevive(eim, player) {
    return false;
}
function scheduledTimeout(eim) {
    eim.disposeIfPlayerBelow(100, 271040210);
    em.setProperty("state", "0");
    em.setProperty("leader", "true");
}
function changedMap(eim, player, mapid) {
    if (mapid != 271040100) {
        eim.unregisterPlayer(player);
        if (eim.disposeIfPlayerBelow(0, 0)) {
            em.setProperty("state", "0");
            em.setProperty("leader", "true");
        }
    }
}
function playerDisconnected(eim, player) {
    return 0;
}
function monsterValue(eim, mobId) {
    var map = eim.setInstanceMap(271040100);
    if (mobId == 8850000 ) {
        var mob5 = em.getMonster(mobId + 2);
               mob5.setHp(6300000000);
        eim.registerMonster(mob5);
        map.spawnMonsterOnGroundBelow(mob5, new java.awt.Point(-363, 100));
 }  
 if (mobId == 8850002 || mobId == 8850003) {
        var mob5 = em.getMonster(mobId + 1);

                    mob5.setHp(6300000000);
            
        eim.registerMonster(mob5);
        map.spawnMonsterOnGroundBelow(mob5, new java.awt.Point(-363, 100));
    } else if (mobId == 8850004) {
        var mob5 = em.getMonster(8850011);
       
        var 女皇寵物 = em.getMonster(8850010);
     
                mob5.setHp(63000000000);
            女皇寵物.setHp(210000000);
        eim.registerMonster(mob5);
        eim.registerMonster(女皇寵物);
        map.spawnMonsterOnGroundBelow(mob5, new java.awt.Point(-363, 100));
        map.spawnMonsterOnGroundBelow(女皇寵物, new java.awt.Point(-303, 100));
    }
    return 1;
}
function playerExit(eim, player) {
    eim.unregisterPlayer(player);
    if (eim.disposeIfPlayerBelow(0, 0)) {
        em.setProperty("state", "0");
        em.setProperty("leader", "true");
    }
}
function pickUpItem(eim, player, itemID) {
}
function end(eim) {
    if (eim.disposeIfPlayerBelow(100, 271040210)) {
        em.setProperty("state", "0");
        em.setProperty("leader", "true");
    }
}
function clearPQ(eim) {
    end(eim);
}
function allMonstersDead(eim) {
}
function leftParty(eim, player) {
}
function disbandParty(eim) {
}
function playerDead(eim, player) {
}
function cancelSchedule() {
}